home *** CD-ROM | disk | FTP | other *** search
- Path: ghost.cbm.com!usenet
- From: Dave Payne <paynedc@cbm.com>
- Newsgroups: comp.lang.c
- Subject: sprintf() question
- Date: Wed, 27 Mar 1996 07:31:30 -0500
- Organization: CBM Technologies, INC
- Message-ID: <31593522.76B3@cbm.com>
- NNTP-Posting-Host: cujo.cbm.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win16; I)
- CC: fraleyrg@cbm.com, campbegd@cbm.com, mecimojs@cbm.com
-
- Question on sprintf():
-
- Is it safe, and more importantly, is it ANSI standard, to use sprintf()
- to print into the same variable? Consider this example:
-
- char foo[100] = "foobar";
-
- sprintf(foo,"%s%s","the string is",foo);
-
- --------------------------------------------
-
- Would the resulting string be "the string is foobar", or will this
- code cause problems because I'm using the same variable (foo) to
- print to as well as read from?
-